Optimal. Leaf size=98 \[ -\frac {b (f g-e h) p q x}{2 f}-\frac {b p q (g+h x)^2}{4 h}-\frac {b (f g-e h)^2 p q \log (e+f x)}{2 f^2 h}+\frac {(g+h x)^2 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )}{2 h} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 98, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {2442, 45, 2495}
\begin {gather*} \frac {(g+h x)^2 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )}{2 h}-\frac {b p q (f g-e h)^2 \log (e+f x)}{2 f^2 h}-\frac {b p q x (f g-e h)}{2 f}-\frac {b p q (g+h x)^2}{4 h} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 2442
Rule 2495
Rubi steps
\begin {align*} \int (g+h x) \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right ) \, dx &=\text {Subst}\left (\int (g+h x) \left (a+b \log \left (c d^q (e+f x)^{p q}\right )\right ) \, dx,c d^q (e+f x)^{p q},c \left (d (e+f x)^p\right )^q\right )\\ &=\frac {(g+h x)^2 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )}{2 h}-\text {Subst}\left (\frac {(b f p q) \int \frac {(g+h x)^2}{e+f x} \, dx}{2 h},c d^q (e+f x)^{p q},c \left (d (e+f x)^p\right )^q\right )\\ &=\frac {(g+h x)^2 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )}{2 h}-\text {Subst}\left (\frac {(b f p q) \int \left (\frac {h (f g-e h)}{f^2}+\frac {(f g-e h)^2}{f^2 (e+f x)}+\frac {h (g+h x)}{f}\right ) \, dx}{2 h},c d^q (e+f x)^{p q},c \left (d (e+f x)^p\right )^q\right )\\ &=-\frac {b (f g-e h) p q x}{2 f}-\frac {b p q (g+h x)^2}{4 h}-\frac {b (f g-e h)^2 p q \log (e+f x)}{2 f^2 h}+\frac {(g+h x)^2 \left (a+b \log \left (c \left (d (e+f x)^p\right )^q\right )\right )}{2 h}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.05, size = 113, normalized size = 1.15 \begin {gather*} a g x-b g p q x+\frac {b e h p q x}{2 f}+\frac {1}{2} a h x^2-\frac {1}{4} b h p q x^2-\frac {b e^2 h p q \log (e+f x)}{2 f^2}+\frac {1}{2} b h x^2 \log \left (c \left (d (e+f x)^p\right )^q\right )+\frac {b g (e+f x) \log \left (c \left (d (e+f x)^p\right )^q\right )}{f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.05, size = 0, normalized size = 0.00 \[\int \left (h x +g \right ) \left (a +b \ln \left (c \left (d \left (f x +e \right )^{p}\right )^{q}\right )\right )\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 117, normalized size = 1.19 \begin {gather*} -b f g p q {\left (\frac {x}{f} - \frac {e \log \left (f x + e\right )}{f^{2}}\right )} - \frac {1}{4} \, b f h p q {\left (\frac {f x^{2} - 2 \, x e}{f^{2}} + \frac {2 \, e^{2} \log \left (f x + e\right )}{f^{3}}\right )} + \frac {1}{2} \, b h x^{2} \log \left (\left ({\left (f x + e\right )}^{p} d\right )^{q} c\right ) + \frac {1}{2} \, a h x^{2} + b g x \log \left (\left ({\left (f x + e\right )}^{p} d\right )^{q} c\right ) + a g x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 150, normalized size = 1.53 \begin {gather*} \frac {2 \, b f h p q x e - {\left (b f^{2} h p q - 2 \, a f^{2} h\right )} x^{2} - 4 \, {\left (b f^{2} g p q - a f^{2} g\right )} x + 2 \, {\left (b f^{2} h p q x^{2} + 2 \, b f^{2} g p q x + 2 \, b f g p q e - b h p q e^{2}\right )} \log \left (f x + e\right ) + 2 \, {\left (b f^{2} h x^{2} + 2 \, b f^{2} g x\right )} \log \left (c\right ) + 2 \, {\left (b f^{2} h q x^{2} + 2 \, b f^{2} g q x\right )} \log \left (d\right )}{4 \, f^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.61, size = 156, normalized size = 1.59 \begin {gather*} \begin {cases} a g x + \frac {a h x^{2}}{2} - \frac {b e^{2} h \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )}}{2 f^{2}} + \frac {b e g \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )}}{f} + \frac {b e h p q x}{2 f} - b g p q x + b g x \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )} - \frac {b h p q x^{2}}{4} + \frac {b h x^{2} \log {\left (c \left (d \left (e + f x\right )^{p}\right )^{q} \right )}}{2} & \text {for}\: f \neq 0 \\\left (a + b \log {\left (c \left (d e^{p}\right )^{q} \right )}\right ) \left (g x + \frac {h x^{2}}{2}\right ) & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 259 vs.
\(2 (94) = 188\).
time = 4.94, size = 259, normalized size = 2.64 \begin {gather*} \frac {{\left (f x + e\right )} b g p q \log \left (f x + e\right )}{f} + \frac {{\left (f x + e\right )}^{2} b h p q \log \left (f x + e\right )}{2 \, f^{2}} - \frac {{\left (f x + e\right )} b h p q e \log \left (f x + e\right )}{f^{2}} - \frac {{\left (f x + e\right )} b g p q}{f} - \frac {{\left (f x + e\right )}^{2} b h p q}{4 \, f^{2}} + \frac {{\left (f x + e\right )} b h p q e}{f^{2}} + \frac {{\left (f x + e\right )} b g q \log \left (d\right )}{f} + \frac {{\left (f x + e\right )}^{2} b h q \log \left (d\right )}{2 \, f^{2}} - \frac {{\left (f x + e\right )} b h q e \log \left (d\right )}{f^{2}} + \frac {{\left (f x + e\right )} b g \log \left (c\right )}{f} + \frac {{\left (f x + e\right )}^{2} b h \log \left (c\right )}{2 \, f^{2}} - \frac {{\left (f x + e\right )} b h e \log \left (c\right )}{f^{2}} + \frac {{\left (f x + e\right )} a g}{f} + \frac {{\left (f x + e\right )}^{2} a h}{2 \, f^{2}} - \frac {{\left (f x + e\right )} a h e}{f^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.29, size = 113, normalized size = 1.15 \begin {gather*} \ln \left (c\,{\left (d\,{\left (e+f\,x\right )}^p\right )}^q\right )\,\left (\frac {b\,h\,x^2}{2}+b\,g\,x\right )+x\,\left (\frac {2\,a\,e\,h+2\,a\,f\,g-2\,b\,f\,g\,p\,q}{2\,f}-\frac {e\,h\,\left (2\,a-b\,p\,q\right )}{2\,f}\right )+\frac {h\,x^2\,\left (2\,a-b\,p\,q\right )}{4}-\frac {\ln \left (e+f\,x\right )\,\left (b\,e^2\,h\,p\,q-2\,b\,e\,f\,g\,p\,q\right )}{2\,f^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________